#include <stdio.h>
void Reverse(int R[],int from,int to){
    int i,temp;
    // for (i=0;i<(to-from+1)/2;i++){
    //     temp=R[from+i];
    //     R[from+i]=R[to-i];
    //     R[to-i]=temp;
    // }
    for (;from<to; from++,to--)
    {
        temp=R[from];
        R[from]=R[to];
        R[to]=temp;
    }
    
}
void Converse(int R[],int n,int p){
    Reverse(R,0,p-1);
    Reverse(R,p,n-1);
    Reverse(R,0,n-1);
    }
int main(){
    int a[10]={1,2,3,4,5,6,7,8,9,10};
    Converse(a,10,4);
    for (int i = 0; i < 10; i++)
    {
        printf("%d ",a[i]);
    }
    
    return 0;
}